package com.geek.javase.Ch02;

import java.util.Scanner;

/**
 * @author chenshupeng
 * @date 2025/9/2
 * @desc 从键盘输入学生成绩，判断学生成绩等级
 **/

public class SwitchDemo {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入第一个成绩：");
        float score = sc.nextFloat();
        int degree=(int)score/10;
        switch(degree)
        {
            case 10:
                System.out.println("成绩A级");break;
            case 9:
                System.out.println("成绩A级");break;
            case 8:
                System.out.println("成绩B级");break;
            case 7:
                System.out.println("成绩C级");break;
            case 6:
                System.out.println("成绩D级");break;
            case 5:
            case 4:
            case 3:
            case 2:
            case 1:
            case 0:
                System.out.println("成绩不合格");
            default:
                System.out.println("非法成绩");
                break;
        }
    }
}
